package com.gloaba.resource.api;

import com.gloaba.common.core.domain.R;
import com.gloaba.resource.api.domain.SysFile;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.InputStream;

public interface OssRemoteService {
    /**
     * @param fileName  文件名称
     * @param contentType 可以为空
     * text/plain	纯文本文件
     * text/html	HTML文件
     * application/pdf	PDF文件
     * image/jpeg	JPEG图像文件
     * audio/mpeg	MPEG音频文件
     * video/mp4	MP4视频文件
     * @param path  可以为空,空则自动生成当天的日期路径
     * @param fileBytes
     * @return
     */
    R<SysFile> upload(String fileName, String contentType, String path, byte[] fileBytes, Boolean useOriginalName);
    R<SysFile> upload(String fileName, String contentType, String path, InputStream fileBytes, Boolean useOriginalName);
    R<SysFile> upload(String fileName, String contentType, String path, String base64Data, Boolean useOriginalName);
    R<SysFile> upload(File file, String contentType, String path, Boolean useOriginalName);
    R<SysFile> upload(MultipartFile file, String path, Boolean useOriginalName);
}
